import {ImageInfo, LicenseInfo} from "../../plugins/dto";
import {BusinessType, BusinessTypeEnum} from "../../type";

export type diffType = BusinessTypeEnum


export interface DiffField {
    label: string,
    key: string,
    value: string | number | boolean | LicenseInfo[] | ImageInfo[]
    oldValue?: string | number | boolean | LicenseInfo[] | ImageInfo[]
    render?: string;
    dismatch?: boolean;
    editable?: boolean;
    multiple?: boolean;
    labelKey?: string;
    cascader?:boolean;
    licenses?: LicenseInfo[]
}


export type diffTypeMapsType = Record<diffType, DiffField[]>

export const diffTypeMaps:diffTypeMapsType = {
    "commodity": [
        {
            label: "标签图",
            key: "tagPicture",
            value: "",
            render: "image",
            editable: false
        },
        {
            label: "商品名称",
            key: "cnName",
            value: "",
            render: "",
            editable: true,
        },
        {
            label: "规格型号",
            key: "specification",
            value: "",
            editable: true
        },
        {
            label: "品牌",
            key: "brandStandardCode",
            value: "",
            editable: false,
            render: "BrandSelect",
            labelKey: "brandName",
            multiple: false
        },
        {
            label: "基本单位",
            key: "minSaleUnit",
            value: "",
            editable: true,
            render: "UnitSelect",
            labelKey: "minSaleUnitName",
            multiple: false
        },
        {
            label: "包装参数:",
            key: "packageParam",
            value: "",
            editable: true,
        },
        {
            label: "证照编号:",
            key: "licenses",
            value: "",
            editable: true,
            labelKey: "licenseCode",
            render: "LicenseSelect",
            multiple: true
        },
        {
            label: "管理类别",
            key: "managementCategory",
            value: "",
            labelKey: "managementCategoryName",
            multiple: false,
            render: "ManageCategory",
            editable: false
        },
        {
            label: "货号:",
            key: "articleNo",
            value: "",
            editable: true,
        },
        {
            label: '商品类型',
            key: "commodityTypeName",
            value: "",
            editable: false
        },
        {
            label: '商品分类',
            key: "classPathId",
            value: "",
            render: "CommodityClassifyEdit",
            labelKey: "classPath",
            cascader: true,
            editable: true
        }
    ],
    "registration": [
        {
            label: "证照编号",
            key: "registration",
            value: ""
        },
        {
            label: "证照类型：",
            key: "registration",
            value: ""
        },
        {
            label: "批准日期:",
            key: "registration",
            value: ""
        },
        {
            label: "审批部门:",
            key: "registration",
            value: ""
        },        {
            label: "有效期至:",
            key: "registration",
            value: ""
        },
        {
            label: "注册人名称:",
            key: "registration",
            value: ""
        },
        {
            label: "管理类别:",
            key: "registration",
            value: ""
        },
        {
            label: "注册人住所:",
            key: "registration",
            value: ""
        },
        {
            label: "产品名称:",
            key: "registration",
            value: ""
        },
        {
            label: "规格型号:",
            key: "registration",
            value: ""
        },
        {
            label: "结构及组成:",
            key: "registration",
            value: ""
        },
        {
            label: "适用范围:",
            key: "registration",
            value: ""
        },
        {
            label: "变更情况:",
            key: "registration",
            value: ""
        },
        {
            label: "其他内容:",
            key: "registration",
            value: ""
        },
        {
            label: "生产地址:",
            key: "registration",
            value: ""
        },
        {
            label: "代理人名称:",
            key: "registration",
            value: ""
        },
        {
            label: "代理人住所:",
            key: "registration",
            value: ""
        },
        {
            label: "备注:",
            key: "registration",
            value: ""
        }
    ],
    "brand": [
        {
            key: "logo",
            value: "",
            label: "品牌图片",
            render: "image",
            editable: false
        },
        {
            key: "commodityPicture",
            value: "",
            label: "品牌产品图片:",
            render: "image",
            editable: false
        },
        {
            key: "cnName",
            value: "",
            label: "品牌名称:",
            editable: false,
            render: ""
        },
        {
            key: "enName",
            value: "",
            label: "英文名称:",
            editable: true,
            render: ''
        },
        {
            key: "companyName",
            value: "",
            editable: true,
            label: "品牌所属公司:",
            render: ''
        }
    ],
    "partnerLicense":[
        {
            "key": "unitLicensePicture",
            "label": "相关附件",
            "value": "",
            "editable": false,
            "render": "image",
            "multiple": false,
            labelKey: "",
          },        
        {
            "key": "licenseCode",
            "label": "许可证号",
            "value": "",
            "editable": false,
            "render": "",
            "labelKey": "",
            "multiple": false
        },
        {
            "key": "companyName",
            "label": "单位名称",
            "value": "",
            "editable": true,
            "render": "",
            "labelKey": "",
            "multiple": false
        },
        {
            "key": "warehouseAddress",
            "label": "注册地址",
            "value": "",
            "editable": true,
            "render": "",
            "labelKey": "",
            "multiple": false
        },
        {
            "key": "disinfectionLicenseName",
            "label": "许可证名称",
            "value": "",
            "editable": true,
            "render": "",
            "labelKey": "",
            "multiple": false
        },
        {
            "key": "businessPremises",
            "label": "生产地址",
            "value": "",
            "editable": true,
            "render": "",
            "labelKey": "",
            "multiple": false
        },

        {
            "key": "legalPerson",
            "label": "法定代表人",
            "value": "",
            "editable": true,
            "render": "",
            "labelKey": "",
            "multiple": false
        },
        {
            "key": "administrativeDivision",
            "label": "行政区划",
            "value": "",
            "editable": true,
            "render": "",
            "labelKey": "",
            "multiple": false
        },
        {
            "key": "licenseHandleDate",
            "label": "办理日期",
            "value": "",
            "editable": true,
            "render": "",
            "labelKey": "",
            "multiple": false
        },
        {
            "key": "businessDateStart",
            "label": "开始日期",
            "value": "",
            "editable": true,
            "render": "",
            "labelKey": "",
            "multiple": false
        },
        {
            "key": "validityPeriod",
            "label": "截止日期",
            "value": "",
            "editable": true,
            "render": "",
            "labelKey": "",
            "multiple": false
        },
        {
            "key": "specificationInAnnex",
            "label": "附件中规格",
            "value": "",
            "editable": true,
            "render": "",
            "labelKey": "",
            "multiple": false
        }
    ]
    ,
    "commodityLicense": [
        {
            "key": "picture",
            "label": "相关附件",
            "value": "",
            "editable": false,
            "render": "image",
            "multiple": false,
            labelKey: "",
        },        
        {
            "key": "licenseCode",
            "label": "注册证编号",
            "value": "",
            "editable": false,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "licenseTypeName",
            "label": "证照类型",
            "value": "",
            "editable": false,
            "render": "",
            "labelKey": "",
            "multiple": false,
        },
        {
            "key": "managementCategory",
            "label": "管理类别",
            "value": "",
            "editable": true,
            "render": "ManageCategory",
            "multiple": false,
            labelKey: "managementCategoryName",
        },
        {
            "key": "licenseName",
            "label": "注册人名称",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "licenseAddress",
            "label": "注册人住所",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "productionAddress",
            "label": "生产地址",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "productName",
            "label": "产品名称",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "approvalDate",
            "label": "批准日期",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "effDate",
            "label": "生效日期",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "periodValidity",
            "label": "有效期至",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "specification",
            "label": "型号规格",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "productDescription",
            "label": "结构及组成",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "expectPurpose",
            "label": "适用范围",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "storageConditions",
            "label": "储存条件",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "annex",
            "label": "附件",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "otherContents",
            "label": "其他内容",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "comment",
            "label": "备注",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "approvalDepartment",
            "label": "审批部门",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },

        {
            "key": "changes",
            "label": "变更情况",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "specificationInAnnex",
            "label": "附件中规格",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        }
    ],
    "foreignLicense": [
        {
            "key": "picture",
            "label": "相关附件",
            "value": "",
            "editable": false,
            "render": "image",
            "multiple": false,
            labelKey: "",
        },          
        {
            "key": "licenseCode",
            "label": "注册证编号",
            "value": "",
            "editable": false,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "licenseTypeName",
            "label": "证照类型",
            "value": "",
            "editable": false,
            "render": "",
            "labelKey": "",
            "multiple": false,
        },
        {
            "key": "managementCategory",
            "label": "管理类别",
            "value": "",
            "editable": true,
            "render": "ManageCategory",
            "multiple": false,
            labelKey: "managementCategoryName",
        },
        {
            "key": "licenseName",
            "label": "注册人名称",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "licenseAddress",
            "label": "注册人住所",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "productionAddress",
            "label": "生产地址",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "agentName",
            "label": "代理人名称",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "agentAddress",
            "label": "代理人住所",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "productName",
            "label": "产品名称",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "approvalDate",
            "label": "批准日期",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "effDate",
            "label": "生效日期",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "periodValidity",
            "label": "有效期至",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "specification",
            "label": "型号规格",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "productDescription",
            "label": "结构及组成",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "expectPurpose",
            "label": "适用范围",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "storageConditions",
            "label": "储存条件",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "annex",
            "label": "附件",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "otherContents",
            "label": "其他内容",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "comment",
            "label": "备注",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "approvalDepartment",
            "label": "审批部门",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },

        {
            "key": "changes",
            "label": "变更情况",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "specificationInAnnex",
            "label": "附件中规格",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        }
    ],
    "domesticRecord": [
        {
            "key": "picture",
            "label": "相关附件",
            "value": "",
            "editable": false,
            "render": "image",
            "multiple": false,
            labelKey: "",
        },          
        {
            "key": "licenseCode",
            "label": "备案号",
            "value": "",
            "editable": false,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "licenseTypeName",
            "label": "证照类型",
            "value": "",
            "editable": false,
            "render": "",
            "labelKey": "",
            "multiple": false
        },
        {
            "key": "managementCategory",
            "label": "管理类别",
            "value": "",
            "editable": true,
            "render": "ManageCategory",
            "multiple": false,
            "labelKey": "managementCategoryName",
        },
        {
            "key": "licenseName",
            "label": "备案人名称",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "licenseAddress",
            "label": "备案人住所",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "productionAddress",
            "label": "生产地址",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "productName",
            "label": "产品名称",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "approvalDate",
            "label": "备案日期",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "specification",
            "label": "型号规格",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "productDescription",
            "label": "产品描述",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "expectPurpose",
            "label": "预期用途",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "storageConditions",
            "label": "储存条件",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "comment",
            "label": "备注",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "approvalDepartment",
            "label": "备案单位",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },

        {
            "key": "changes",
            "label": "变更情况",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "specificationInAnnex",
            "label": "附件中规格",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        }
    ],
    "foreignRecord": [
        {
            "key": "picture",
            "label": "相关附件",
            "value": "",
            "editable": false,
            "render": "image",
            "multiple": false,
            labelKey: "",
        },          
        {
            "key": "licenseCode",
            "label": "备案号",
            "value": "",
            "editable": false,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "licenseTypeName",
            "label": "证照类型",
            "value": "",
            "editable": false,
            "render": "",
            "labelKey": "",
            "multiple": false
        },
        {
            "key": "managementCategory",
            "label": "管理类别",
            "value": "",
            "editable": true,
            "render": "ManageCategory",
            "multiple": false,
            labelKey: "managementCategoryName",
        },
        {
            "key": "licenseName",
            "label": "备案人名称",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "licenseAddress",
            "label": "备案人住所",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "productionAddress",
            "label": "生产地址",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "agentName",
            "label": "代理人名称",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "agentAddress",
            "label": "代理人住所",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "productName",
            "label": "产品名称",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "approvalDate",
            "label": "备案日期",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "specification",
            "label": "型号规格",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "productDescription",
            "label": "产品描述",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "expectPurpose",
            "label": "预期用途",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "storageConditions",
            "label": "储存条件",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "comment",
            "label": "备注",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "approvalDepartment",
            "label": "备案单位",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },

        {
            "key": "changes",
            "label": "变更情况",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        },
        {
            "key": "specificationInAnnex",
            "label": "附件中规格",
            "value": "",
            "editable": true,
            "render": "",
            "multiple": false,
            labelKey: "",
        }
    ]
}